package com.shilei.templateMethod;

/**
 * @description: 模板方法  钩子函数
 * @author: 81271
 * @date: 2020-04-25 11:28
 */
public class Main {
    public static void main(String[] args) {
        F f = new C1();
        f.m();
    }
}

abstract class F {
    void m() {
        oo1();
        oo2();
    }

    protected abstract void oo1();

    protected abstract void oo2();
}

class C1 extends F{

    @Override
    protected void oo1() {
        System.out.println("123145");
    }

    @Override
    protected void oo2() {
        System.out.println("123145");
    }
}
